import request from '@/utils/request'
import axios from 'axios'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}
export function register(a,b,c) { //注册
  return request({
    url: '/admin/register',
    method: 'post',
    data: a,b,c 
  })
  // return axios.post('/admin/register',user)
}

export function getInfo(token) {
  return request({
    url: '/admin/get_by_id',
    method: 'get',
    params: { token }
  })
}

export function changePwd(data) {
  return request({
    url: '/admin/update_Pass',
    method: 'post',
    params:{
      token:   data.token,
      oldPass: data.oldPass,
      newPass: data.newPass
    }
  })
}


export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

